<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户信息</title>
    <link rel="stylesheet" href="../css/index.css">
    <!--日期显示js-->
    <script type="text/javascript" src="js/showdate.js"></script>
    <!--省市县js-->
    <script type="text/javascript" src="js/js3city.js"></script>
    <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>

    <style type="text/css">
    	#anniu{
    		 	position: absolute;
				top:950px;
				left:900px;
    	}
    	
    </style>
</head>
<body>
<script type="text/javascript">
			var user=null; 
			$(function(){
				var u = localStorage.getItem("user");
				console.log(u);
				user=JSON.parse(u);
				console.log(user.id)
			$.post("../gUser",{
			id:user.id
		},function(res){
			console.log(res);
			$("#gerenxinxi").append(`
					 <div class="user-info-info">
	                    <table border="0" cellpadding="0" cellspacing="0" width="900">
	                        <tr>
	                            <td height="55" width="200" align="right">我的姓名：</td>
	                            <td height="55" width="50" align="right">${res.username}</td>
	                		
	                            <td class="xiugaikuang" align="right"><input id="username" type="text" name="d_name" class="info-text" value="${res.username}"></td>
	                            <td>
	                            </td>
	                        </tr>
	                    </table>
              	 	 </div>

                <!--修改昵称-->
               
                <!--性别-->
                <div class="user-info-info">
                <table border="0" cellpadding="0" cellspacing="0" width="900">
                    <tr>
                        <td height="55" width="200" align="right">个人性别：</td>
                        <td height="55" width="50" align="right">${res.sex}</td>
            			
                        <td  align="right">
		                        <select id="sex" name="d_name" onchange="chooseProvince(this)">
			              
									<option value="男">男</option>
									<option value="女">女</option>
								</select>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
      	 	 </div>

                <!--年龄-->
                <div class="user-info-info">
                <table border="0" cellpadding="0" cellspacing="0" width="900">
                    <tr>
                        <td height="55" width="200" align="right">我的年龄：</td>
                        <td height="55" width="50" align="right">${res.age}</td>
            			
                        <td align="right"><input id="age" type="text" name="d_name" class="info-text" value="${res.age}"></td>
                        <td> 
                        </td>
                    </tr>
                </table>
      	 	 </div>
                <!--手机号-->
                <div class="user-info-info">
                <table border="0" cellpadding="0" cellspacing="0" width="900">
                    <tr> 
                        <td height="55" width="200" align="right">手机号码：</td>
                        <td height="55" width="20" align="right">${res.phone}</td>
            			
                        <td  align="right"><input maxlength="11" id="phone" type="text" name="d_name" class="info-text" value="${res.phone}"></td>
                        <td>
                        </td>
                    </tr>
                </table>
      	 	 </div>

                <!--邮箱-->
                <div class="user-info-info">
                <table border="0" cellpadding="0" cellspacing="0" width="900">
                    <tr>
                        <td height="55" width="200" align="right">我的邮箱：</td>
                        <td height="55" width="50" align="right">${res.email}</td>
            			
                        <td align="right"><input id="email" type="text" name="d_name" class="info-text" value="${res.email}"></td>
                        <td>
                        </td>
                    </tr>
                </table>
      	 	 </div>
      	 	 <!--身份证号-->
             <div class="user-info-info">
             <table border="0" cellpadding="0" cellspacing="0" width="900">
                 <tr>
                     <td height="55" width="200" align="right">身份号码：</td>
                     <td height="55" width="50" align="right">${res.idCard}</td>
         			
                     <td  align="right"><input maxlength="18" id="idCard" type="text" name="d_name" class="info-text" value="${res.idCard}"></td>
                     <td> 
                     </td>
                 </tr>
             </table>
   	 	 </div> 
   	 	 
   	 	 <!--邮箱-->
         <div class="user-info-info">
         <table border="0" cellpadding="0" cellspacing="0" width="900">
             <tr>
                 <td height="55" width="200" align="right">我的生日：</td>
                 <td height="55" width="70" align="right">${res.birthday}</td>
     			
                 <td align="right"><input id="birthday" type="date" name="d_name" class="info-text" value="${res.birthday}"></td>
                 <td> 
                 </td> 
             </tr>
         </table>
	 	 </div>
	 	 
                <!--所在地区end!-->

              
 
					`)
			},"json")	
		})
		
			function updateUser(){
				$.post("../updateUser",{
					id:user.id,
					username:$("#username").val(),
					sex:$("#sex").val(),
					age:$("#age").val(),
					phone:$("#phone").val(),
					email:$("#email").val(),
					idCard:$("#idCard").val(),
					birthday:$("#birthday").val()
				},function(res){
					console.log(res) 
			 		if(res.code=="0"){ 
						alert("修改成功")  
						window.location.href = "user-info.html";
					}else{
						alert("修改失败")
					}
				},"json");
			}
		
</script>;
<!--header-->
<div class="header2">
    <div class="header-box">
        <div class="header">
            <div class="header-left-title">
             
            </div>
            <div class="header-center-title">
                <ul>
                    <li><a href="user.html">我的AnJun</a></li>
                    <li><a href="../cart.html">购物车</a><span class="count">1</span></li>
                    <li><a href="">我的订单</a></li>
                    <li><a href="">收藏网站</a></li>
                    <li><a href="">积分</a></li>
                </ul>


            </div>
            <div class="header_right_title">
                <ul>
                    <li><a href="">我要供货</a></li>
                    <li><a href="">客服中心<i class="kefu-icon"><img src="../images/kefu.png" alt="" width="20" height="20"></i></a></li>

                </ul>

            </div>


        </div>
        <div class="header-nav-box">
            <div class="nav">
                <div class="nav-logo">
                    <a href="" class="logo"><img src="../images/logo.png" alt=""></a>
                </div>
                <div class="nav-search-box">
                    <form action="" name="fomr1">
                        <div class="nav-search">
                            <div class="bar1">
                                <input type="text" placeholder="请输入您要搜索的内容..." class="text"><button type="submit" class="btn">搜索</button>
                            </div>
                        </div>
                    </form>
                </div>
               

            </div>
            <div class="nav-daohang">
                <div class="daohang">
                    <ul>
                        <li><a href="../goods.html">全部分类</a></li>
                        <li><a href="../index.html">首页</a></li>
                        <li><a href="">选品采购</a></li>
                        <li><a href="../daigou.html">指定代购</a></li>
                        <li><a href="../need.html"> 需求提交</a></li>
                        <li><a href="">个性定制</a></li>
                        <li><a href="../wl-case.html">物流方案</a></li>
                        <li><a href="../join.html">我要入驻</a></li>
                        <li><a href="../us.html">关于我们</a></li>

                    </ul></div>
            </div>

        </div>
    </div>
</div>
<!--hearder end!-->


<div class="user-order-box">

    <div class="user-order">
        <div class="home-location-box">
            <div class="goods-location">
                <i><img src="../images/icon/home.png" alt="" width="18" height="18"></i>
                <span><a href="">首页</a></span>
                <span>></span>
                <span><a href="">个人信息</a></span>

            </div>


        </div>

        <div class="user-order-main">
            <!--个人中心左侧栏目-->
            <div class="home-box-left">
                <ul>
                    <h3><i><img src="../images/icon/user-products.png" width="18" alt="18"></i>&nbsp;订单中心</h3>
                    <li><a href="user-cart.html">我的购物车</a></li>
                    <li><a href="user-order.html">订单管理</a></li>

                </ul>

                <ul><h3><i><img src="../images/icon/us.png" width="18" alt="18"></i>&nbsp;会员中心</h3>
                    <li><a href="user.html">个人中心</a></li>
                    <li><a href="user_id.html">实名认证</a></li>
                    <li><a href="user-info.html">个人信息</a></li>
                    <li><a href="user-safe.html">账户管理</a></li>
                    <li><a href="user-addr.html">收货地址</a></li>
                    <li><a href="user-message.html">我的消息</a></li>
                    <li><a href="user-money.html">我的余额</a></li>
                    <li><a href="user-shop-collection.html">我的收藏</a></li>
                    <li><a href="user-invoice.html">发票管理</a></li>
                    <li><a href="user-jifen.html">我的积分</a></li>
                    <li><a href="user-money.html">在线充值</a></li>
                </ul>

                <ul><h3><i><img src="../images/icon/kefu.png" width="18" alt="18"></i>&nbsp;客户服务</h3>
                    <li><a href="user-tuihuo.html">退款及退货</a></li>
                    <li><a href="#">平台客服</a></li>
                    <li><a href="user-feedback.html">意见反馈</a></li>

                </ul>

            </div>
            <!--个人中心左侧栏目end!-->

            <div class="user-order-manager" >
                <!--通用DIV-->
                <div class="order-manager-title">
                    <a href="">个人基本信息</a>
                </div>
                <!--通用DIV end-->

                <div class="user-info-main" id="gerenxinxi">
                    <div class="user-info-img">
                        <img src="images/default_user_portrait.gif" alt="">
                        <div class="user-level">LV1</div>
                    </div>

                    <!--当前昵称显示-->
                </div>

  	  <!--修改按钮-->
					<button id="anniu" class="user-addr-btn" onclick="updateUser()">
						保存修改 
					</button>
					 



        </div>



    </div>

</div>


<!--footer-->
<div class="footer-box">
    <div class="footer-list-box">
        <div class="footer-list">
            <ul><img src="../images/icon/about.png" alt="" width="20" height="20">&nbsp;关于我们
                <li class="magin"><a href="">关于安骏</a></li>
                <li><a href="">产品服务</a></li>
                <li><a href="">联系我们</a></li>
                <li><a href="">企业文化</a></li>
            </ul>
        </div>

        <div class="footer-list">
            <ul><img src="../images/icon/zhinan.png" alt="" width="20" height="20">&nbsp;新手指南
                <li class="magin"><a href="">新手福利</a></li>
                <li><a href="">推荐有奖</a></li>
                <li><a href="">会员中心</a></li>
                <li><a href="">我的积分</a></li>
                <li><a href="">客服中心</a></li>
            </ul>
        </div>

        <div class="footer-list">
            <ul><img src="../images/icon/zhifu.png" alt="" width="20" height="20">&nbsp;支付方式
                <li class="magin"><a href="">支付宝</a></li>
                <li><a href="">WeChat</a></li>
                <li><a href="">前海支付</a></li>
                <li><a href="">银联支付</a></li>
                <li><a href="">其它支付</a></li>
            </ul>
        </div>

        <div class="footer-list">
            <ul><img src="../images/icon/daohang.png" alt="" width="20" height="20">&nbsp;网站导航
                <li class="magin"><a href="">选品采购</a></li>
                <li><a href="">指定代购</a></li>
                <li><a href="">需求提交</a></li>
                <li><a href="">我要入驻</a></li>
                <li><a href="">系统登录</a></li>
            </ul>
        </div>

        <div class="footer-list">
            <ul><img src="../images/kefu.png" alt="" width="20" height="20">&nbsp;客服电话：
                <li class="magin" id="phone"><a href="">0755-12345678</a></li>
                <li><a href="">地址：深圳市龙岗区坂田街道格泰隆工业园</a></li>
                <li><a href="">邮箱：123456789@qq.com</a></li>

            </ul>
        </div>

        <div class="footer-list" style="margin-left: 100px;">
            <ul><img src="../images/app.jpg" alt="" width="150" height="150">
                <li class="magin" id="guanzhu"><a href="">关注安骏</a></li>

            </ul>
        </div>


    </div>
    <div class="footer-footer">
        © 2020-2020 AnJun DCM  All Rights Reserved 9.0 备案号：123456789

    </div>

</div>
<!--footer end!-->

    <!--省市县三级联动js-->
    <script type="text/javascript">
        addressInit('shen', 'city', 'xian', '请选择省', '请选择市', '请选择县');
    </script>
</body>
</html>